home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / SLAX 6.0.8 / slax-6.0.8.iso / slax / base / 006-devel.lzm / usr / include / kabc / locknull.h < prev    next >
Encoding:
C/C++ Source or Header  |  2005-10-10  |  1.4 KB  |  55 lines

  1. /*
  2.     This file is part of libkabc.
  3.  
  4.     Copyright (c) 2003 Cornelius Schumacher <schumacher@kde.org>
  5.  
  6.     This library is free software; you can redistribute it and/or
  7.     modify it under the terms of the GNU Library General Public
  8.     License as published by the Free Software Foundation; either
  9.     version 2 of the License, or (at your option) any later version.
  10.  
  11.     This library is distributed in the hope that it will be useful,
  12.     but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  14.     Library General Public License for more details.
  15.  
  16.     You should have received a copy of the GNU Library General Public License
  17.     along with this library; see the file COPYING.LIB.  If not, write to
  18.     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  19.     Boston, MA 02110-1301, USA.
  20. */
  21. #ifndef KABC_LOCKNULL_H
  22. #define KABC_LOCKNULL_H
  23.  
  24. #include <qstring.h>
  25.  
  26. #include "lock.h"
  27.  
  28. namespace KABC {
  29.  
  30. /**
  31.   This class provides a lock without actually locking. It can be constructed in
  32.   two ways: One that let all locks succeed and one that let all locks fail.
  33. */
  34. class KABC_EXPORT LockNull : public Lock
  35. {
  36.   public:
  37.     LockNull( bool allowAccess );
  38.     ~LockNull();
  39.  
  40.     bool lock();
  41.     bool unlock();
  42.  
  43.     QString error() const;
  44.  
  45.   private:
  46.     bool mAllowAccess;
  47.  
  48.     class Private;
  49.     Private *d;
  50. };
  51.  
  52. }
  53.  
  54. #endif
  55.